#!/bin/sh

current_dir=$(cd $(dirname $0); pwd)
project_name=source-admin
echo ${current_dir}

VERSION_NUM=1.0
DOCKER_TAG=source-admin:${VERSION_NUM}

cp -f /opt/source-vue-config/* /opt/gitee/source-vue/source-admin/src/main/resources/

cd ${current_dir}/../../
mvn clean package
cd ${current_dir}
cp -f /opt/gitee/source-vue/source-admin/target/source-admin.jar ./source-admin.jar

echo " docker build -f Dockerfile -t ${DOCKER_TAG} ."
docker build -f Dockerfile -t ${DOCKER_TAG} .
docker save -o ${current_dir}/../images/source-admin.tar ${DOCKER_TAG}
echo "#################################################################"
echo " docker push ${DOCKER_TAG}"

#docker build -t source-admin .
#docker run -p 8022:80 -d source-admin